package com.example.yimai.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.yimai.entity.ProductCategory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProductCategoryMapper extends BaseMapper<ProductCategory> {

    @Select("select * from easybuy_product_category where parentId = #{id}")
    public List<ProductCategory> findChildCategory(int id);

    @Select("select * from easybuy_product_category where parentId = 0")
    public List<ProductCategory> findTopCategory();

}
